![]() |
ALMaSS
1.0
The Animal, Landscape and Man Simulation System
|
The class to handle all newt population related matters. More...
#include <Newt_Population_Manager.h>
Public Member Functions | |
Newt_Population_Manager (Landscape *L) | |
Newt_Population_Manager Constructor. More... | |
virtual | ~Newt_Population_Manager (void) |
Newt_Population_Manager Destructor. More... | |
void | CreateObjects (int ob_type, TAnimal *pvo, struct_Newt *data, int number) |
Method for creating a new individual Newt. More... | |
int | IsBreedingSeason () |
Returns whether it is breeding season or not. More... | |
void | SetFreeLivingMortChance () |
Calculate the daily background mortality chance based on weather. More... | |
double | GetEggDDRateTransformation (double a_temperature) |
Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees. More... | |
virtual void | TheAOROutputProbe () |
Special output functionality. More... | |
void | RecordAdultProduction (int a_adult) |
Add a new adult to the stats record. More... | |
void | RecordEggProduction (int a_eggs) |
Add a new egg production to the stats record. More... | |
void | RecordMetamorphosis (int a_age) |
Add a new metamorphosis time to the stats record. More... | |
void | InitOutputMetamorphosisStats () |
Initialises output mean and variance for meatamorphosis times this year. More... | |
void | OutputMetamorphosisStats () |
Output mean and variance for meatamorphosis times this year. More... | |
![]() | |
Population_Manager (Landscape *L) | |
virtual | ~Population_Manager (void) |
void | SetNoProbes (int a_pn) |
unsigned | GetLiveArraySize (int a_listindex) |
Gets the number of 'live' objects for a list index in the TheArray. More... | |
void | IncLiveArraySize (int a_listindex) |
Increments the number of 'live' objects for a list index in the TheArray. More... | |
virtual void | Catastrophe (int) |
unsigned int | FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal) |
char * | SpeciesSpecificReporting (int a_species, int a_time) |
char * | ProbeReport (int a_time) |
char * | ProbeReportTimed (int a_time) |
void | ImpactProbeReport (int a_Time) |
bool | BeginningOfMonth () |
void | LOG (const char *fname) |
int | SupplyStepSize () |
int | SupplySimW () |
int | SupplySimH () |
virtual void | Run (int NoTSteps) |
virtual float | Probe (int ListIndex, probe_data *p_TheProbe) |
virtual void | ImpactedProbe () |
int | SupplyListNameLength () |
TAnimal * | SupplyAnimalPtr (int a_index, int a_animal) |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More... | |
unsigned | SupplyListIndexSize () |
unsigned | SupplyListSize (unsigned listindex) |
bool | CheckXY (int l, int i) |
Debug method to test for out of bounds coordinates. More... | |
const char * | SupplyListName (int i) |
bool | IsLast (unsigned listindex) |
int | SupplyState (unsigned listindex, unsigned j) |
virtual void | SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y) |
const char * | SupplyStateNames (int i) |
unsigned | SupplyStateNamesLength () |
virtual void | DisplayLocations () |
int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
TAnimal * | FindClosest (int x, int y, unsigned Type) |
bool | OpenTheRipleysOutputProbe (string a_NWordFilename) |
void | OpenTheAOROutputProbe (string a_AORFilename) |
bool | OpenTheMonthlyRipleysOutputProbe () |
bool | OpenTheReallyBigProbe () |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
virtual void | TheReallyBigOutputProbe () |
void | CloseTheMonthlyRipleysOutputProbe () |
virtual void | CloseTheRipleysOutputProbe () |
virtual void | CloseTheReallyBigOutputProbe () |
TTypesOfPopulation | GetPopulationType () |
int | GetSeasonNumber () |
Get the season number. More... | |
void | LamdaDeath (int x, int y) |
void | LamdaBirth (int x, int y) |
void | LamdaBirth (int x, int y, int z) |
void | LamdaClear () |
void | LamdaDumpOutput () |
virtual int | SupplyPegPosx (int) |
virtual int | SupplyPegPosy (int) |
virtual int | SupplyCovPosx (int) |
virtual int | SupplyCovPosy (int) |
virtual bool | OpenTheFledgelingProbe () |
virtual bool | OpenTheBreedingPairsProbe () |
virtual bool | OpenTheBreedingSuccessProbe () |
virtual void | BreedingPairsOutput (int) |
virtual int | TheBreedingFemalesProbe (int) |
virtual int | TheFledgelingProbe () |
virtual void | BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int) |
virtual int | TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &) |
virtual void | FledgelingProbeOutput (int, int) |
virtual void | TheGeneticProbe (unsigned, int, unsigned &) |
virtual void | GeneticsResultsOutput (FILE *, unsigned) |
Protected Member Functions | |
virtual void | DoFirst () |
Things to do before anything else at the start of a timestep More... | |
void | SetUnsetBreedingSeason () |
Controls when it is breeding season More... | |
![]() | |
virtual bool | StepFinished () |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More... | |
virtual void | DoBefore () |
virtual void | DoAfter () |
virtual void | DoAlmostLast () |
virtual void | DoLast () |
void | EmptyTheArray () |
Removes all objects from the TheArray by deleting them and clearing TheArray. More... | |
void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
unsigned | PartitionLiveDead (unsigned Type) |
void | Shuffle_or_Sort (unsigned Type) |
void | Shuffle (unsigned Type) |
virtual void | Catastrophe () |
Protected Attributes | |
int | m_BreedingSeasonFlag |
Set to 0 when it is newt breeding season, then records the number of days after. More... | |
double | m_NewtEgg_DDTempRate [31] |
An array to hold a precalulated day-degree rate transformation for egg development. More... | |
SimpleStatistics | m_NewtMetamorphosisStats |
A class for holding the stats on newt metamorphosis development times. More... | |
SimpleStatistics | m_NewtEggProdStats |
A class for holding the stats on newt egg production. More... | |
SimpleStatistics | m_NewtAdultProdStats |
A class for holding the stats on newt adult production. More... | |
![]() | |
vector< unsigned > | m_LiveArraySize |
int | m_NoProbes |
AOR_Probe * | m_AOR_Probe |
FILE * | m_GeneticsFile |
FILE * | m_AlleleFreqsFile |
FILE * | m_EasyPopRes |
const char * | StateNames [100] |
int | m_catastrophestartyear |
int | m_StepSize |
vector< TListOfAnimals > | TheArray |
unsigned | StateNamesLength |
const char * | m_ListNames [32] |
unsigned | m_ListNameLength |
FILE * | TestFile |
FILE * | TestFile2 |
unsigned | BeforeStepActions [12] |
int | m_SeasonNumber |
Holds the season number. Used when running goose and hunter sims. More... | |
TTypesOfPopulation | m_population_type |
ofstream * | AOROutputPrb |
FILE * | RipleysOutputPrb |
FILE * | RipleysOutputPrb1 |
FILE * | RipleysOutputPrb2 |
FILE * | RipleysOutputPrb3 |
FILE * | RipleysOutputPrb4 |
FILE * | RipleysOutputPrb5 |
FILE * | RipleysOutputPrb6 |
FILE * | RipleysOutputPrb7 |
FILE * | RipleysOutputPrb8 |
FILE * | RipleysOutputPrb9 |
FILE * | RipleysOutputPrb10 |
FILE * | RipleysOutputPrb11 |
FILE * | RipleysOutputPrb12 |
FILE * | ReallyBigOutputPrb |
long int | lamdagrid [2][257][257] |
Additional Inherited Members | |
![]() | |
int | IndexArrayX [5][10000] |
probe_data * | TheProbe [100] |
int | SimH |
int | SimW |
unsigned | SimHH |
unsigned | SimWH |
char | m_SimulationName [255] |
bool | ProbesSet |
Landscape * | m_TheLandscape |
The class to handle all newt population related matters.
Newt_Population_Manager::Newt_Population_Manager | ( | Landscape * | L | ) |
Newt_Population_Manager Constructor.
This class takes care of newt object creation and any list management methods. This is handled by In addition the newt population managner must control the breeding season flag, done in SetUnsetBreedingSeason
References struct_Newt::age, cfg_LarvalFoodProportion, cfg_newt_startnumber, cfg_Newt_Test_Pesticide_Egg, cfg_Newt_Test_Pesticide_Larva, cfg_Newt_Test_Pesticide_Terrestrial, cfg_NewtAdultPPPEffectProbability, cfg_NewtAdultPPPToxEliminationRate, cfg_NewtAdultPPPToxTrigger, cfg_newtdailyeggproductionvolume, cfg_newtdormancyhumidity, cfg_newtdormancytemp, cfg_NewtEggDevelDDParameter, cfg_NewtEggDevelTotal, cfg_NewtEggMortalityChance, cfg_NewtEggPPPEffectProbability, cfg_NewtEggPPPToxEliminationRate, cfg_NewtEggPPPToxTrigger, cfg_newteggproductionvolume, cfg_newtgoodhabitatdispersalprob, cfg_NewtJuvenileDailyLengthGain, cfg_NewtJuvenileDevelSize, cfg_NewtJuvenilePPPEffectProbability_EnvConc, cfg_NewtJuvenilePPPEffectProbability_Overspray, cfg_NewtJuvenilePPPToxEliminationRate, cfg_NewtJuvenilePPPToxTrigger_EnvConc, cfg_NewtJuvenilePPPToxTrigger_Overspray, cfg_NewtLarvaDailyGrowthIncrement, cfg_NewtLarvaDevelThresholdLowerSz, cfg_NewtLarvaDevelThresholdTime, cfg_NewtLarvaDevelThresholdUpperSz, cfg_NewtLarvaMortalityChance, cfg_NewtLarvaPPPEffectProbability, cfg_NewtLarvaPPPToxEliminationRate, cfg_NewtLarvaPPPToxTrigger, cfg_newtpoorhabitatdispersalprob, cfg_NewtRoadMortalityProb, cfg_NewtWalkSpeed, cfg_NewtWalkStepsize, cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, CreateObjects(), g_msg, Population_Manager::GetLiveArraySize(), InitOutputMetamorphosisStats(), struct_Newt::L, Newt_Adult::m_AdultPPPEffectProbability, Newt_Adult::m_AdultPPPElimRate, Newt_Adult::m_AdultPPPThreshold, m_BreedingSeasonFlag, Newt_Female::m_eggdailyproductionvolume, Newt_Base::m_EggDevelopmentDDParameter, Newt_Base::m_EggDevelopmentDDTotal, Newt_Base::m_EggMortalityChance, Newt_Egg::m_EggPPPEffectProbability, Newt_Egg::m_EggPPPElimRate, Newt_Egg::m_EggPPPThreshold, Newt_Female::m_eggproductionvolume, Newt_Juvenile::m_goodhabitatdispersalprob, Newt_Juvenile::m_JuvenileDailyWeightGain, Newt_Base::m_JuvenileDevelopmentSize, Newt_Juvenile::m_JuvenilePPPEffectProbability_EnvConc, Newt_Juvenile::m_JuvenilePPPEffectProbability_Overspray, Newt_Juvenile::m_JuvenilePPPElimRate, Newt_Juvenile::m_JuvenilePPPThreshold_EnvConc, Newt_Juvenile::m_JuvenilePPPThreshold_Min, Newt_Juvenile::m_JuvenilePPPThreshold_Overspray, Newt_Larva::m_LarvaDevelopmentLowerSz, Newt_Larva::m_LarvaDevelopmentTime, Newt_Larva::m_LarvaDevelopmentUpperSz, Newt_Larva::m_LarvalFoodProportion, Newt_Larva::m_LarvaMortalityChance, Newt_Larva::m_LarvaPPPEffectProbability, Newt_Larva::m_LarvaPPPElimRate, Newt_Larva::m_LarvaPPPThreshold, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, Newt_Adult::m_newtadultwalkspeed, Newt_Juvenile::m_NewtDormancyHumidity, Newt_Juvenile::m_NewtDormancyTemperature, m_NewtEgg_DDTempRate, Newt_Larva::m_NewtLarvaDailyGrowthIncrement, Newt_Juvenile::m_newtwalkspeed, Newt_Juvenile::m_newtwalkstepsize, Newt_Juvenile::m_poorhabitatdispersalprob, Newt_Juvenile::m_roadmortalityprob, Newt_Juvenile::m_SimH, Population_Manager::m_SimulationName, Newt_Juvenile::m_SimW, Newt_Base::m_test_pesticide_egg, Newt_Base::m_test_pesticide_larva, Newt_Base::m_test_pesticide_terrestrial, Population_Manager::m_TheLandscape, struct_Newt::NPM, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), struct_Newt::pondrefs, Population_Manager::ReallyBigOutputPrb, struct_Newt::reproinhib, Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyElementType(), Landscape::SupplyPondIndex(), Landscape::SupplyRandomPondRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), Population_Manager::TheArray, tole_Pond, tton_Female, tton_Male, CfgInt::value(), CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), struct_Newt::x, and struct_Newt::y.
|
virtual |
Newt_Population_Manager Destructor.
void Newt_Population_Manager::CreateObjects | ( | int | ob_type, |
TAnimal * | pvo, | ||
struct_Newt * | data, | ||
int | number | ||
) |
Method for creating a new individual Newt.
References struct_Newt::age, Population_Manager::GetLiveArraySize(), Population_Manager::IncLiveArraySize(), struct_Newt::L, struct_Newt::NPM, struct_Newt::pondrefs, RecordEggProduction(), Newt_Larva::ReInit(), Newt_Juvenile::ReInit(), Newt_Male::ReInit(), Newt_Female::ReInit(), struct_Newt::reproinhib, Newt_Base::SetAge(), Newt_Juvenile::SetWeight(), Population_Manager::TheArray, tton_Egg, tton_Female, tton_Juvenile, tton_Larva, tton_Male, struct_Newt::weight, struct_Newt::x, and struct_Newt::y.
Referenced by Newt_Population_Manager(), Newt_Female::st_Breed(), Newt_Egg::st_NextStage(), Newt_Larva::st_NextStage(), and Newt_Juvenile::st_NextStage().
|
protectedvirtual |
Things to do before anything else at the start of a timestep
Reimplemented from Population_Manager.
References cfg_breedingseasonend, cfg_breedingseasonstart, Population_Manager::GetLiveArraySize(), m_BreedingSeasonFlag, Population_Manager::m_TheLandscape, OutputMetamorphosisStats(), SetFreeLivingMortChance(), Landscape::SupplyDayInYear(), Population_Manager::TheArray, tton_Female, and CfgInt::value().
|
inline |
Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees.
Uses the precalulated m_NewtEgg_DDTempRate array for speed optimisation. Rounds to the nearest degree.
References m_NewtEgg_DDTempRate.
Referenced by Newt_Egg::st_Develop().
void Newt_Population_Manager::InitOutputMetamorphosisStats | ( | ) |
Initialises output mean and variance for meatamorphosis times this year.
Referenced by Newt_Population_Manager().
|
inline |
Returns whether it is breeding season or not.
References m_BreedingSeasonFlag.
Referenced by Newt_Female::st_Breed(), Newt_Adult::st_EvaluateHabitat(), and Newt_Female::st_EvaluateHabitat().
void Newt_Population_Manager::OutputMetamorphosisStats | ( | ) |
Output mean and variance for meatamorphosis times this year.
References SimpleStatistics::ClearData(), SimpleStatistics::get_meanvalue(), SimpleStatistics::get_N(), SimpleStatistics::get_Total(), SimpleStatistics::get_varianceP(), Population_Manager::GetLiveArraySize(), m_NewtAdultProdStats, m_NewtEggProdStats, m_NewtMetamorphosisStats, Population_Manager::m_TheLandscape, Landscape::SupplyYearNumber(), tton_Female, tton_Juvenile, and tton_Male.
Referenced by DoFirst().
void Newt_Population_Manager::RecordAdultProduction | ( | int | a_adult | ) |
Add a new adult to the stats record.
References SimpleStatistics::add_variable(), and m_NewtAdultProdStats.
Referenced by Newt_Adult::Init().
void Newt_Population_Manager::RecordEggProduction | ( | int | a_eggs | ) |
Add a new egg production to the stats record.
References SimpleStatistics::add_variable(), and m_NewtEggProdStats.
Referenced by CreateObjects().
void Newt_Population_Manager::RecordMetamorphosis | ( | int | a_age | ) |
Add a new metamorphosis time to the stats record.
References SimpleStatistics::add_variable(), and m_NewtMetamorphosisStats.
Referenced by Newt_Larva::st_NextStage().
void Newt_Population_Manager::SetFreeLivingMortChance | ( | ) |
Calculate the daily background mortality chance based on weather.
The model for daily newt mortality in free-living stages and out of water is based on Griffiths et al (2010). It assumes survival is inversely releated to rainfall Jun-Feb and minimum winter mean (Dec-Feb). This method calculates the daily probability of survival assuming 270 days of season and 0.0016 reduction for each 1mm rain above 200mm and 0.1 reduction for each 1 degree above -2 during the 90 days of Winter assumed by Griffiths et al (2010). The two survival curves are added and divided by 2 (equal weight and central tendency). Because we use seasonal data we only need to calculate this at the beginning of the season. Initial tests show that extending these relationships outside the range of the original data leads to extreme mortalities and therefore input data is constrained to lie within the maximum bounds of the original data used for the relationships. This daily rate of mortality is applied each day so the overall survival rate per year is transformed to daily probability needed to achieve this.
References cfg_NewtNARMortalityFactor, cfg_NewtWTMortalityFactor, December, g_date, g_rand_uni, June, Newt_Base::m_AdultMortalityChance, Newt_Base::m_JuvenileMortalityChance, Population_Manager::m_TheLandscape, Calendar::OldDays(), Landscape::SupplyDayInYear(), Landscape::SupplyRainPeriod(), Landscape::SupplyTempPeriod(), and CfgFloat::value().
Referenced by DoFirst().
|
protected |
Controls when it is breeding season
|
virtual |
Special output functionality.
Reimplemented from Population_Manager.
References AOR_Probe::DoProbe(), Population_Manager::m_AOR_Probe, and tton_Female.
|
protected |
Set to 0 when it is newt breeding season, then records the number of days after.
Referenced by DoFirst(), IsBreedingSeason(), and Newt_Population_Manager().
|
protected |
A class for holding the stats on newt adult production.
Referenced by OutputMetamorphosisStats(), and RecordAdultProduction().
|
protected |
An array to hold a precalulated day-degree rate transformation for egg development.
Referenced by GetEggDDRateTransformation(), and Newt_Population_Manager().
|
protected |
A class for holding the stats on newt egg production.
Referenced by OutputMetamorphosisStats(), and RecordEggProduction().
|
protected |
A class for holding the stats on newt metamorphosis development times.
Referenced by OutputMetamorphosisStats(), and RecordMetamorphosis().